package com.button.job;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class AsyncJob {

    @Async
    public void successAsyncJob() {
        try {
            log.info("/success的异步方法开始执行了......");
            for(int i = 0; i < 1000000; i++) {
                log.info("打印{}", i);
            }
            log.info("/success的异步方法执行完了......");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
